import Vue from 'vue'
import VueRouter from 'vue-router'
// import login form "../login/login.vue"



const User = {
  template: "<h1>User 手动注册一个组件</h1>",
};
// 这在单页面里手动注册一个组件

Vue.use(VueRouter)

const routes = [ 
  {
    path: '/',
    name:'layout',
    component:User
    // component: () => import('@/layout/layout.vue')
  },
  {
  path: '/login',
  name: 'login',
  component: () => import('@/login/login.vue')
},
 {
  path: '/layout',
  name: 'layout',
  component: () => import('@/layout/layout.vue'),
      children:[ 
      {
        path: '/my',
        name:'my',
        component: () => import('@/views/my/my.vue')
      },
      {
          path: '/video',
          name:'video',
        component: () => import('@/views/video/video.vue')
      },
       {
         path: '/qa',
         name:'qa',
         component: () => import('@/views/qa/qa.vue')
      },
      {
        path: '/home',
        name:'home',
        component: () => import('@/views/home/home.vue')
     },
]
},
]

const router = new VueRouter({
  routes
 
})

export default router
